<form class="import-modal-form" role="form" ng-submit="import()">
  <div class="modal-header">
    <button type="button" class="close" ng-click="cancel()">
      <span aria-hidden="true">&times;</span>
      <span class="sr-only">Close</span>
    </button>
    <h3 class="modal-title" translate="home.import.headerLabel">Import Pipeline Definition</h3>
  </div>
  <div class="modal-body">

    <ng-include src="'app/home/alerts/error/errorAlert.tpl.html'"></ng-include>

    <div class="form-group btn-group toggle-toolbar" ng-show="pipelineInfo">
      <label class="btn btn-default btn-sm" ng-model="createNewPipeline" btn-radio="false">
        {{'home.import.overwritePipeline' | translate}}
      </label>
      <label class="btn btn-default btn-sm" ng-model="createNewPipeline" btn-radio="true">
        {{'home.import.createPipelineAndImport' | translate}}
      </label>
    </div>

    <div class="form-group" show-errors="{ trigger: 'keypress' }" ng-if="createNewPipeline">
      <label class="control-label" translate="global.form.title">Title</label>
      <input type="text"
             autofocus
             name="name"
             class="form-control"
             ng-required
             placeholder="{{'home.library.namePlaceholder' | translate}}"
             ng-model="newConfig.title"
             focus-me="true">
      <p class="help-block">{{'home.library.nameValidation' | translate}}</p>
    </div>

    <div class="form-group" ng-if="createNewPipeline">
      <label class="control-label" translate="global.form.description">Description</label>
      <textarea class="form-control" rows="2"
                placeholder="{{'home.library.descriptionPlaceholder' | translate}}"
                ng-model="newConfig.description"></textarea>
    </div>

    <div class="input-group">
      <span class="input-group-btn">
          <span class="btn btn-primary btn-file">
              {{'home.import.browse' | translate}}&hellip; <input type="file" fileread="uploadFile">
          </span>
      </span>
      <input type="text" class="form-control" readonly ng-model="uploadFile.name"
             placeholder="{{'home.import.fileUploadPlaceholder' | translate}}">
    </div>

  </div>
  <div class="modal-footer">
    <button type="reset" class="btn btn-default" ng-click="cancel()"
            translate="global.form.cancel">Cancel</button>
    <button type="submit" class="btn btn-primary" ng-disabled="!uploadFile.name"
            translate="global.form.import">Import</button>
  </div>
</form>
